var mainApp = angular.module('mainApp', ['app.services', 'app.directives', 'app.controllers', 'app.routes', 'ngFileUpload', "ui.bootstrap", "oc.lazyLoad", "ngSanitize", "ngCookies", "summernote", "angular-md5", 'ng-nestable', 'treeControl'])
    .config(['$controllerProvider', '$locationProvider', '$ocLazyLoadProvider', function($controllerProvider, $locationProvider, $ocLazyLoadProvider) {
        // this option might be handy for migrating old apps, but please don't use it
        // in new ones!
        console.log("app.config");
        $locationProvider.hashPrefix('');
        $controllerProvider.allowGlobals();
        $ocLazyLoadProvider.config({
            // global configs go here
        });
    }])
    .run(["$rootScope", "$timeout", "$state", "dataApi", function($rootScope, $timeout, $state, dataApi) {
        $rootScope.$currentMenu = "";
        $rootScope.$state = $state;
        $rootScope.sysConfigs = sysConfigs;
        console.log("app.run");
        //stateChangeSuccess
        $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {
            $rootScope.sysConfigs.pageTitle = toState.data.pageTitle;
        });
    }]);